package com.sss.service.impl;

import com.sss.entity.WmStorageLocation;
import com.sss.mapper.WmStorageLocationMapper;
import com.sss.service.WmStorageLocationService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
 * 库区表(WmStorageLocation)表服务实现类
 *
 * @author makejava
 * @since 2023-12-14 16:55:33
 */
@Service("wmStorageLocationService")
public class WmStorageLocationServiceImpl implements WmStorageLocationService {
    @Autowired
    private WmStorageLocationMapper wmStorageLocationMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param locationId 主键
     * @return 实例对象
     */
    @Override
    public WmStorageLocation queryById(Long locationId) {
        return this.wmStorageLocationMapper.queryById(locationId);
    }

    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @Override
    public List<WmStorageLocation> queryByPage(Long pageNum) {
        return this.wmStorageLocationMapper.queryAllByLimit();
    }

    /**
     * 新增数据
     *
     * @param wmStorageLocation 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(WmStorageLocation wmStorageLocation) {
        return this.wmStorageLocationMapper.insert(wmStorageLocation);
    }

    /**
     * 修改数据
     *
     * @param wmStorageLocation 实例对象
     * @return 实例对象
     */
    @Override
    public int update(WmStorageLocation wmStorageLocation) {
        return this.wmStorageLocationMapper.update(wmStorageLocation);
    }

    /**
     * 通过主键删除数据
     *
     * @param locationId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long locationId) {
        return this.wmStorageLocationMapper.deleteById(locationId) > 0;
    }
}
